<include file="Public:header" />
<div id="zoneHeader">
    <h2>广告管理</h2>
    <flag:isadmin>
    <ul>
        <li><button type="button" action="playAd">开启</button></li>
        <li><button type="button" action="lockAd">锁定</button></li>
        <li><a href="?c=Ad&a=copy2" class="btn" target="_blank">复制广告</a></li>
        <li><a href="?c=Ad&a=move2" class="btn" target="_blank">移动广告</a></li>
        <li><a href="?c=Ad&a=del" class="btn" t="firm" m="确认删除已选定数据吗？" m2="请选择需要删除的数据" reload="1">删除</a></li>
    </ul>
    </flag:isadmin>
</div><!--/#zoneHeader-->
<div id="zoneBody">
    <div id="zoneBodySearch">
        <form id="formSearch" action="?c={$Think.const.MODULE_NAME}">
            <input type="hidden" name="sort" />
            <input type="hidden" name="sortdir" />

            <ul>
                <li><b>
                    <select name="search_item_1">
                        <option value="id">广告编号</option>
                        <option value="uid">广告主编号</option>
                        <option value="user_name">广告主名称</option>
                        <option value="plan_id">计划编号</option>
                    </select> ：</b>
                    <input type="text" name="search_item_val_1" class="fW100p" />
                </li>
                <li rel="searchMoreItem"><b>计划名称：</b><input type="text" name="plan_name" class="fW100p" /></li>
                <li><b>广告尺寸：</b><input type="text" name="width" class="fW40p" /> X <input type="text" name="height" class="fW40p"/></li>
                <li rel="searchMoreItem">
                    <select name="plan_type">
                        <option value="">计费模式</option>
                        <volist name=":C('PLAN_TYPE')" id="vo">
                        <option value="{$vo}">{$vo|strtoupper}</option>
                        </volist>
                    </select>
                </li>
                <li>
                    <select name="type">
                        <option value="">广告类型</option>
                        <volist name=":C('AD_TYPE')" id="vo">
                        <option value="{$key}">{$vo|strtoupper}</option>
                        </volist>
                    </select>
                </li>
                <li>
                    <select name="status">
                        <option value="">广告状态</option>
                        <volist name=":C('AD_STATUS')" id="vo">
                        <option value="{$key}">{$vo}</option>
                        </volist>
                    </select>
                </li>
                <li><button type="button" id="as" class="btnSearch">查询</button></li>
                <li><button type="button" class="btnResetForm">清空表单</button></li>
                <li><label><input type="checkbox" class="btnSearchMore" /><span>高级查询</span></label></li>
            </ul>
        </form>
    </div><!--/#zoneBodySearch-->
    <div id="zoneBodyContent">
        <table class="table2">
            <thead>
                <tr>
                    <th style="width:15px"><input type="checkbox" t="checkboxChoiceMasterDom" /></th>
                    <th class="tAr"><a href="javascript:;" sort="id">广告编号</a></th>
                    <th><a href="javascript:;" sort="plan_name">所属计划</a></th>
                    <th><a href="javascript:;" sort="type">广告类型</a></th>
                    <th><a href="javascript:;" sort="size">广告规格</a></th>
                    <th><a href="javascript:;" sort="status">状态</a></th>
                    <th><a href="javascript:;" sort="create_time">创建时间</a></th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="page.record" id="vo">
                <tr>
                    <td><input type="checkbox" t="checkboxChoiceItemDom" name="id[]" g="checkboxItem" value="{$vo.id}" /></td>
                    <td class="tAr">{$vo.id}</td>
                    <td><a href="{$Think.server.request_uri}&search_item_1=plan_id&search_item_val_1={$vo.plan_id}&plan_id={$vo.plan_id}" title="查询此计划所有广告">{$vo.plan_id}-{$vo.plan_id|getPlanNameById}</a></td>
                    <td>{$vo.type|getAdTypeCn}</td>
                    <td><a href="{$Think.server.request_uri}&width={$vo.width}&height={$vo.height}">{$vo.width}x{$vo.height}</a></td>
                    <td>{$vo.status|getAdStatusCn}</td>
                    <td>{$vo.create_time}</td>
                    <td class="tAction">
                        <if condition="$vo.status NEQ 1">
                        <a href="?c=Ad&a=changeStatus&id={$vo.id}&status=1" t="firm" m="确认开启此广告吗？">开启</a>
                        </if>
                        <if condition="$vo.status EQ 1">
                        <a href="?c=Ad&a=changeStatus&id={$vo.id}&status=2" t="firm" m="确认停止此广告吗？">停止</a>
                        </if>
                        <flag:isadmin>
                        <a href="?c=Ad&a=modify&id={$vo.id}">编</a>
                        <a href="?c=Ad&a=del&id={$vo.id}" t="firm" m="确认删除此广告吗？">删</a>
                        </flag:isadmin>
                    </td>
                </tr>
                </volist>
            </tbody>
        </table>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<div id="zoneFooter">{:W('Page/info', [$page])}</div><!--/#zoneFooter-->
<include file="Public:footer" />
